/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package net.tygzs.minerpg.CommandExecutor.MineItem;

import net.tygzs.minerpg.Configuration.Item.RPGItem;
import net.tygzs.minerpg.Configuration.Item.RPGItem.RPGItemType;
import net.tygzs.minerpg.Main;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

/**
 *
 * @author thtTNT
 */
public class Command_Type
{

    public static void setType(CommandSender sender, String ItemName, String Type)
    {
        if (Main.getPluginConfig().getItem(ItemName) == null)
        {
            sender.sendMessage(ChatColor.RED + "物品不存在");
            return;
        }
        if (RPGItemType.getRPGItemType(Type) == null)
        {
            sendTypeList(sender);
            return;
        }
        Main.getPluginConfig().getItem(ItemName).setType(RPGItemType.getRPGItemType(Type));
        sender.sendMessage(ChatColor.GREEN + "设置成功");
    }

    public static void sendTypeList(CommandSender sender)
    {
        sender.sendMessage(ChatColor.GREEN + "目前只支持以下类型:");
        sender.sendMessage(ChatColor.GREEN + "Normal(普通)");
        sender.sendMessage(ChatColor.GREEN + "Helmet(头盔)");
        sender.sendMessage(ChatColor.GREEN + "Chestplate(胸甲)");
        sender.sendMessage(ChatColor.GREEN + "Leggings(护腿)");
        sender.sendMessage(ChatColor.GREEN + "Boots(鞋子)");
    }
}
